﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CCF20Model;
using WiseLink.RDS.Resource;

namespace CCF20Model.FaultHandler
{
    public class InContactCustomerFaultHandler : FaultHandlerBase
    {
        public InContactCustomerFaultHandler(IFaultHandler faultHandler)
        {
            this.PreviousHandler = faultHandler;
            this.MyVehicle = faultHandler.MyVehicle;
            this.MyFault = faultHandler.MyFault;
            this.ccf20Ent = faultHandler.ccf20Ent;
        }
        public override void ProcessRequest()
        {
            LoggerHelper.LogZICDebug("[进入处理已处于联系中客户]");
            IFaultHandler nextHandler = null;
            if (!MyFault.FaultType.Contains(WiseLinkRDSStatus.Fault_Type_Urgent))
            {
                //如果是撞车，   即使客户已经处于联系中，也显示撞车请求
                CloseFault(MyVehicle.LastContactResult);
                LoggerHelper.LogZICDebug("[已处于联系中客户]-不是撞车请求-屏蔽");
                nextHandler = new CompleteFaultHandler(this);
            }
            else
            {
                LoggerHelper.LogZICDebug(string.Format("[已处于联系中客户]-{0}-是撞车请求-不屏蔽", MyVehicle.LastContactResult));
                nextHandler = new ProcessMaintenaceHandler(this);
            }
            nextHandler.ProcessRequest();
        }
    }
}
